﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using metroCIS.ViewModel;
using metroCIS.Win8Application.Views;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace metroCIS.Win8Application
{
    public sealed partial class Main : Page
    {
        public static Main MainView { get; private set; }

        public Main()
        {
            this.InitializeComponent();

            MainView = this;
            NavigateTo(typeof(Overview));
        }

        public void NavigateTo(Type viewType)
        {
            InnerFrame.Navigate(viewType);
            backButton.IsEnabled = InnerFrame.CanGoBack;
        }

        private void backButton_Click_1(object sender, RoutedEventArgs e)
        {
            if(InnerFrame.CanGoBack)
                InnerFrame.GoBack();
            backButton.IsEnabled = InnerFrame.CanGoBack;
        }
    }
}
